<!--
 * @Author: Bennty
 * @Date: 2024-08-23 01:12:54
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-08-23 01:27:26
 * @Description: 请填写简介
-->
<template>
    <el-dialog v-model="props.visible" title="合并部位" @close="handleClose" width="25%" destroy-on-close>
        <el-table :data="mergeData">
            <el-table-column label="部件名称" prop="componentName" />
            <el-table-column label="库位" prop="warehousePosition" />
            <el-table-column label="部件数量">
                <template #default="scope">
                    <el-input v-model="scope.row.inventoryNumber"/>
                </template>
            </el-table-column>
        </el-table>
        <template #footer>
            <div class="dialog-footer">
                <el-button  type="primary" >确 定</el-button>
                <el-button @click="handleClose">取 消</el-button>
            </div>
        </template>
    </el-dialog>
</template>

<script setup lang="ts">
import type { FormInstance } from 'element-plus';
const props = defineProps(['visible','data']);
const emits = defineEmits(['close']);
const mergeFormRef = ref<FormInstance>();
const mergeData = computed(()=>props.data);


const handleClose = ()=>{
    mergeFormRef.value?.resetFields();
    emits('close');
};
</script>

<style scss="lang" scoped>
.dialog-footer{
    display: flex;
    justify-content: center;
}
</style>